﻿using CarAppDto.Base;
using CarAppDto.CarType.BrandDtos;
using CarAppDto.CarType.CarTypeDtos;
using FluentValidation;

namespace CarAppDto.CarType.CarDtos
{
    public class ReqAddCarTypeValidator : AbstractValidator<ReqAddCarType>
    {
        /// <summary>
        /// 校验规则写到校验类的构造方法中
        /// </summary>
        public ReqAddCarTypeValidator()
        {
            RuleFor(x => x.BrandId).NotEmpty().Length(1, 36);
            RuleFor(x => x.VehicleSeriesId).NotEmpty().Length(1, 36);
            RuleFor(x => x.Name).NotEmpty().Length(1, 128);
            RuleFor(x => x.Code).NotEmpty().Length(1, 20);
        }
    }

    public class ReqAddCarType : BaseAddModel
    {
        /// <summary>
        /// 所属品牌代码
        /// </summary>
        public string? BrandId { get; set; }

        /// <summary>
        /// 所属车系代码（车系ID）
        /// </summary>
        public string? VehicleSeriesId { get; set; }

        /// <summary>
        /// 车型中文名称
        /// </summary>
        public string? Name { get; set; }

        /// <summary>
        /// 车型英文名称
        /// </summary>
        public string? EnglishName { get; set; }

        /// <summary>
        /// 车型代码
        /// </summary>
        public string? Code { get; set; }

        /// <summary>
        /// 车型型号
        /// </summary>
        public string? VehicleModel { get; set; }


        /// <summary>
        /// 销售区域Id
        /// </summary>
        public string? SaleAreaId { get; set; }

        /// <summary>
        /// 制造国Id
        /// </summary>    
        public string? ManufacturingCountryId { get; set; }

        /// <summary>
        /// 年代代码
        /// </summary>     
        public string? ModelYearCode { get; set; }


        /// <summary>
        ///目录号
        /// </summary>    
        public string? CatalogNo { get; set; }


        /// <summary>
        /// 上市时间
        /// </summary>   
        public DateTime? MarketingTime { get; set; }

        /// <summary>
        /// 停产时间
        /// </summary>    
        public DateTime? DownTime { get; set; }

        /// <summary>
        /// 图片
        /// </summary>     
        public string? Image { get; set; }

        /// <summary>
        /// 零件
        /// </summary>
        public List<CarPartsCarType> CarParts { get; set; } = new List<CarPartsCarType>();

        /// <summary>
        /// 车型类型【0：普通车型，1,：销售车型，2：精准车型】
        /// </summary>
        public int VehicleType { get; set; }=0;
    }
}
